import request from '../utils/request'

// 获取教室列表
export function getClassroomList() {
  return request({
    url: '/classroom/list',
    method: 'get'
  })
}

// 分页获取教室列表
export function getClassroomPage(params) {
  return request({
    url: '/classroom/page',
    method: 'get',
    params
  })
}

// 根据ID获取教室详情
export function getClassroomById(id) {
  return request({
    url: `/classroom/${id}`,
    method: 'get'
  })
}

// 添加教室
export function addClassroom(classroom) {
  return request({
    url: '/classroom/add',
    method: 'post',
    data: classroom
  })
}

// 更新教室
export function updateClassroom(classroom) {
  return request({
    url: '/classroom/update',
    method: 'put',
    data: classroom
  })
}

// 删除教室
export function deleteClassroom(id) {
  return request({
    url: `/classroom/delete/${id}`,
    method: 'delete'
  })
}

// 批量删除教室
export function batchDeleteClassrooms(ids) {
  return request({
    url: '/classroom/batch-delete',
    method: 'delete',
    data: ids
  })
}

// 更新教室状态
export function updateClassroomStatus(id, status) {
  return request({
    url: `/classroom/update-status/${id}`,
    method: 'put',
    params: { status }
  })
}

// 获取教室类型列表
export function getClassroomTypes() {
  return request({
    url: '/classroom/types',
    method: 'get'
  })
}

// 获取楼栋列表
export function getBuildings() {
  return request({
    url: '/classroom/buildings',
    method: 'get'
  })
}

// 根据类型获取可用教室
export function getAvailableClassroomsByType(classroomType) {
  return request({
    url: `/classroom/available/${classroomType}`,
    method: 'get'
  })
}
























